﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DAL
{
    public interface IBuiltSQL
    {
        DataTable GetOneInfo(string tableName, string[] primaryKey);
        DataTable GetList(string tableName, string filter);
        bool ExecSQL(string strSQL);
        DataSet ExecSQL2(string strSQL);


        string DeleteTable(string tableName, string[] primaryKey);//删除一行
        string DeleteTable(string tableName, string[] primaryKey, ArrayList arrayList);//附带执行其它SQL语句
        //插入一行
        bool InsertTable(string tableName, SortedDictionary<string, string> sdList);
        bool InsertTable(string tableName, SortedDictionary<string, string> sdList, ArrayList arrayList);//附带执行其它SQL语句

        bool UpdateTable(string tableName, SortedDictionary<string, string> sdList);//更新一行
        bool UpdateTable(string tableName, SortedDictionary<string, string> sdList, ArrayList arrayList);//附带执行其它SQL语句
        //插入多表的数据
        string InsertMultiTable(List<String[,]> detailList);
      
        //后三个方法是同事对主表和明细表操作
        string InsertMainAndDetail(string mainTable, SortedDictionary<string, string> mainList, string detailTable, List<SortedDictionary<string, string>> detailList);
        string UpdateMainAndDetail(string mainTable, SortedDictionary<string, string> mainList, string[] primaryKey, string detailTable, List<SortedDictionary<string, string>> detailList);
        string InsertMainAndDetail(string mainTable, List<String[]> mainList, string detailTable, string fCode, List<String[]> detailList);
    }
}
